﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.DS
{
    public static partial class classes
    {
        public static dynamic cleanStudentList(int cid)
        {
            var sql = new Sql.SqlDataContext();
            if (!sql.DSClass.Any(row => row.cid == cid)) return new
                {
                    success = false,
                    msg = "班级不存在"
                };
            sql.DSClassStudent.DeleteAllOnSubmit(sql.DSClassStudent.Where(row => row.cid == cid));
            sql.SubmitChanges();
            return new
            {
                success = true
            };
        }
    }
}
